<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    html,body{
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
</style>
<body>
    <button id="btn">跳转</button>
    <h1>我是首页</h1>
    <script>
        const btn = document.getElementById('btn');
        btn.onclick = function(){
            parent.document.getElementById('frame').setAttribute('src','./search.html')
        }
    </script>
</body>
</html>